package ru.hh.team02.chat.messaging;

import ru.hh.team02.chat.client.Client;

/*
 * message for MessageSender.
 */
public class Message {
    private final String text;
    private final Client client;
    
    public Client getClient() {
                return client;
        }

        public String getText() {
                return text;
        }

        /**
     * Create a message.
     * @param text Message text
     * @param p Client this message is addressed to
     */
    public Message(String text, Client client) {
        this.text = text;
        this.client = client;
    }
    
    public void sendMessage() {
        getClient().sendMessageToClientComputer(text);
    }
}
